package cn.edu360.day7

import java.text.SimpleDateFormat
import java.util.Calendar

/**
  * Created by sw on 2018/3/30
  */
object Tool {

  def getYesterday(): String = {
    var dateFormat: SimpleDateFormat = new SimpleDateFormat("yyyyMMdd")
    var cal: Calendar = Calendar.getInstance()
    cal.add(Calendar.DATE, -1)
    var yesterday = dateFormat.format(cal.getTime())
    yesterday

  }

  def main(args: Array[String]): Unit = {
    println(Tool.getYesterday())
  }

}
